package com.heima.model.behavior.pojos;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;
import org.apache.ibatis.type.Alias;

/**
 * <p>
 * 文章点赞表
 * </p>
 *
 * @author fkn
 * @since 2024-08-21
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("ap_parise")
@ApiModel(value="ApParise对象", description="文章点赞表")
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ApParise implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "主键ID")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "用户ID")
    private Integer userId;

    @ApiModelProperty(value = "文章ID")
    private Long articleId;

    @ApiModelProperty(value = "动态ID")
    private Long dynamicId;

    @ApiModelProperty(value = "0文章 1动态 2评论")
    private Integer type;

    @ApiModelProperty(value = "点赞时间")
    private LocalDateTime pariseTime;

    @Alias("ApPariseType")
    public enum type{
        ARTICLE(0),DYNAMIC(1),REMARK(2);
        int code;
        type(int code){
            this.code = code;
        }
        public int getCode(){
            return this.code;
        }
    }
}
